/**
 * 图片js
 * Created by Sublime Text 3.
 * @authors Rejeo (rejeo@qq.com)
 * @date    2018-04-23 18:06:34
 * @version $Id$
 */
$(function() {
  $('#file_upload').uploadify({
    'swf'             : SCOPE.uploadify_swf,
    'uploader'        : SCOPE.image_upload,
    'buttonText'      : '图片上传',
    'fileTypeDesc'    : 'Image files',
    'fileObjName'     : 'file',
    'fileTypeExts'    : '*.jpg; *.png; *.gif',
    'onUploadSuccess' : function (file, data, response) {
      if (response) {
        var data = $.parseJSON(data);
        $('#upload_org_code_img').attr('src', data.msg);
        $('#file_upload_image').attr('value', data.msg);
        $('#upload_org_code_img').show();
      }
    },
  });
  $('#file_upload_other').uploadify({
    'swf'             : SCOPE.uploadify_swf,
    'uploader'        : SCOPE.image_upload,
    'buttonText'      : '图片上传',
    'fileTypeDesc'    : 'Image files',
    'fileObjName'     : 'file',
    'fileTypeExts'    : '*.jpg; *.png; *.gif',
    'onUploadSuccess' : function (file, data, response) {
      if (response) {
        var data = $.parseJSON(data);
        $('#upload_org_code_img_other').attr('src', data.msg);
        $('#file_upload_image_other').attr('value', data.msg);
        $('#upload_org_code_img_other').show();
      }
    },
  });
});
